﻿function FeedBack()
{
    var prefix = "ctl00_ContentPlaceHolder1_";
    var content = document.getElementById(prefix + "txtContent");
    var capcode = document.getElementById("captcode");

    if (content.value.length == 0)
    {
        alert("请输入反馈内容！");
        content.focus();
        return false;
    }
    if (capcode.value.length == 0)
    {
        alert("请输入验证码！");
        capcode.focus();
        return false;
    }

    $.ajax({
        type: "GET",
        cache: false,
        url: 'ajax/FeedBack.aspx',
        data: ({ content: content.value, capcode: capcode.value, code: Math.random() }),
        dataType: 'html',
        success: function (obj)
        {
            if (obj == '1')
            {
                alert("提交反馈成功，感谢您的关注");
                window.location = 'Index.aspx';
                return true;
            }
            if (obj == '2')
            {
                alert("验证码错误");
                chgCap();
                return false;
            }
            chgCap();
            alert('提交反馈失败');
            return false;

        }
    });
}